package com.dongjiantong.openplatform.core;/**
 * Created by cao on 2017/12/13.
 */

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author cao
 * @create 2017-12-13 下午8:24
 **/
@Configuration
@EnableWebMvc
@ComponentScan
@EnableConfigurationProperties({OpenProperties.class})
public class OpenPlatformAutoConfiguration extends WebMvcConfigurerAdapter {
    public OpenPlatformAutoConfiguration() {
    }

    @Bean
    public PushPostHandle postHandle() {
        return new DefaultPushPostHandle();
    }

    @Bean
    @ConditionalOnMissingBean({ObjectMapper.class})
    public ObjectMapper objectMapper() {
        return new ObjectMapper();
    }
}
